home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_0799 / 556 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  1.1 KB

  1. Date: Mon, 18 Oct 93 09:59:44 -0700
  2. From: ersmith@netcom.com (Eric R. Smith)
  3. Message-Id: <9310181659.AA14044@netcom2.netcom.com>
  4. To: itschere@techfak.uni-bielefeld.de, mint@atari.archive.umich.edu
  5. Subject: Re:  pipes & ptys
  6.  
  7. Fselect() provides a way to sleep for less than 1 second (to sleep for n
  8. milliseconds, do Fselect(n, 0L, 0L, 0L)).
  9.  
  10. The other thing you can do to speed up pipe I/O is to always try to
  11. Fread() and process more than 1 byte at a time. Usually there will be more
  12. than 1 byte written into the pipe at once (e.g. in a window system the
  13. caller will write a window command and some arguments all in one block).
  14. If you have the flags set appropriately,
  15.    r = Fread(pipefd, bufsiz, buffer);
  16. will read either "bufsiz" bytes, or as many as are available, whichever
  17. is smaller. This can be a very big win. If you're only reading 1 byte
  18. at a time, then effectively the entire system gets slowed down to 1 character
  19. at a time I/O (since even if a program tries to write 4K bytes at once, only
  20. 1 character will typically manage to get into the pipe buffer at a time).
  21.  
  22. Regards,
  23. Eric
  24.